Generally, folders, various application programs, and icons of files are set in a user interface on an electronic device such as a smartphone or a computer, so that a user may perform a drag operation on an icon to readjust an icon layout in the interface.
In the prior art, when a user long presses an icon on a home screen, an icon editing mode is triggered. In the icon editing mode, the user may drag the icon. When a dragging speed is less than a specified value, a system determines that the user stops dragging, and at this time, starts to calculate distances between a center point of the dragged icon and locations nearby that are used to display an icon, to find a target location closest to the center point. When a distance between the dragged icon and the target location is greater than a preset threshold, an operation of replacing or pushing away an icon at the target location is performed. When a distance between the dragged icon and the target location is less than the preset threshold, an operation of integrating the icon at the target location and the dragged icon into a folder is performed. However, in an actual use process, the user cannot well control a movement speed and the distance between the dragged icon and the target location, resulting in that a feedback by the electronic device on an operation by the user deviates from an action actually expected by the user. For example, the user actually intends to perform an icon integration operation, but the electronic device performs a replacement operation because a dragging speed is less than a speed designed for a product. Therefore, the operation is inconsistent with an actual requirement of the user, resulting in degradation of use experience of the user.